<!-- 列表 -->
<extend name="Public:layout" />
<block name="title"><{$authName}></block>

<block name="pluginCSS">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/plugins/select2/select2.css"/>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/plugins/select2/select2-metronic.css"/>

<link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/plugins/bootstrap-fileinput/bootstrap-fileinput.css"/>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/plugins/bootstrap-timepicker/css/bootstrap-timepicker.min.css"/>
</block>
<block name="CSS"></block>

<block name="loadJS">
<script src="__PUBLIC__/Admin/plugins/bootstrap-fileinput/bootstrap-fileinput.js"></script>
<script type="text/javascript" src="__PUBLIC__/Admin/plugins/select2/select2.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/Admin/plugins/bootstrap-timepicker/js/bootstrap-timepicker.min.js"></script>
<script src="__PUBLIC__/admin/scripts/layer/layer.js" type="text/javascript"></script>	
<script src="__PUBLIC__/admin/plugins/jquery-validation/dist/jquery.validate.min.js" type="text/javascript"></script>
<script type="text/javascript" src="http://webapi.amap.com/maps?v=1.3&key=8dc81ff542fd466a6975eb39939957c6"></script>
<!-- <script type="text/javascript" src="http://cache.amap.com/lbs/static/addToolbar.js"></script> -->

</block>
<block name="setJS">
<script src="__PUBLIC__/Admin/scripts/custom/validateShops.js"></script>
<script>
var ajaxUrl="<{:U('index')}>";
var managerId="<{$Think.session.managerId}>";
var areaId1 = "<{$shops.areaId1}>";
var areaId2 = "<{$shops.areaId2}>";
var areaId3 = "<{$shops.areaId3}>";

function callback(message,status)  {  
	if(status==1)  {  
		layer.msg(message, 
			{icon: 1,time: 2000},
			function(){
				location.href=ajaxUrl;
			}
		);   
	}  else{  
		layer.msg(message, 
			{icon: 2,time: 2000}
		);   
		
	}  
}  
</script>
</block>
<block name="initJS">

ValidateShops.init();
</block>

<block name="pagetitle">增删改查</block>
<block name="page">
<div class="row">
	<div class="col-md-12">

		<div class="portlet">
			<div class="portlet-title">
				<div class="caption">
					<i class="fa <{$authIco}>"></i><{$authName}>
				</div>				
				<div class="actions">
					<a class="btn default green-stripe" id="table_manager_new" data-toggle="modal" href="javascript:history.back()">
						<i class="fa fa-reply"></i>
						<span class="hidden-480">返回</span>
					</a>
				</div>				
			</div>
			<div class="portlet-body">				
				<form class="form-horizontal" action="<{:U('index')}>" method="post" target="ajax" enctype="multipart/form-data">
				<iframe style="display:none" name='ajax' id="ajax" ></iframe>
				<input type="hidden" name="noAjax" value="editShops">
				<input type="hidden" class="form-control" placeholder="shopId" name="shopId" id="shopId"  value="<{$shops.shopId}>" />
				<div class="tabbable">
					<ul class="nav nav-tabs">
						<li class="active">
							<a href="#tab_general" data-toggle="tab">
								 基本信息
							</a>
						</li>
						<li>
							<a href="#tab_meta" data-toggle="tab">
								 详细信息
							</a>
						</li>
						
					</ul>
					<div class="tab-content no-space">
						<div class="tab-pane active" id="tab_general">
							<div class="form-body">
								<div class="col-sm-6">
									<php>if(empty($shops['shopId'])):</php>
									<div class="form-group">
										<label class="col-sm-4 control-label" for="loginName">登录用户名</label>
										<div class="col-md-8">
											<input type="text" class="form-control" placeholder="用户名" name="loginName" id="loginName"  value="<{$users.loginName}>" />
										</div>
									</div>
									<div class="form-group">
										<label class="col-sm-4 control-label" for="loginPwd">登录密码</label>
										<div class="col-md-8">
											<input type="password" class="form-control" placeholder="密码" name="loginPwd" id="loginPwd"  value="<{$users.loginPwd}>" />
										</div>
									</div>
									<php>endif;</php>
									<div class="form-group">
										<label class="col-sm-4 control-label" for="shopSn">店铺编号</label>
										<div class="col-md-8">
											<input type="text" class="form-control" placeholder="店铺编号" name="shopSn" id="shopSn"  value="<{$shops.shopSn}>" />
										</div>
									</div>
									<div class="form-group">
										<label class="col-sm-4 control-label" for="shopName">店铺名称</label>
										<div class="col-md-8">
											<input type="text" class="form-control" placeholder="店铺名称" name="shopName" id="shopName"  value="<{$shops.shopName}>" />
										</div>
									</div>
									<div class="form-group">
										<label class="col-sm-4 control-label" for="shopCompany">公司名称</label>
										<div class="col-md-8">
											<input type="text" class="form-control" placeholder="公司名称" name="shopCompany" id="shopCompany"  value="<{$shops.shopCompany}>" />
										</div>
									</div>
									<div class="form-group">
										<label class="col-sm-4 control-label" for="goodsCatId1">所属行业</label>
										<div class="col-md-8">
											<select class="form-control" name="goodsCatId1" id="goodsCatId1">
											<option>请选择所属行业</option>
											<foreach name="catName1" item="val" key="key" >
													<option value="<{$val['catId']}>" <php> echo $val['catId'] ==$shops['goodsCatId1']?'selected':'';</php>><{$val['catName']}></option>
											</foreach>
											</select>
										</div>
									</div>
									<div class="form-group">
										<label class="col-sm-4 control-label" for="shopTel">店铺电话</label>
										<div class="col-md-8">
											<input type="text" class="form-control" placeholder="店铺电话" name="shopTel" id="shopTel"  value="<{$shops.shopTel}>" />
										</div>
									</div>
									<div class="form-group">
										<label class="col-sm-4 control-label" for="qqNo">店铺QQ号码</label>
										<div class="col-md-8">
											<input type="text" class="form-control" placeholder="店铺QQ号码" name="qqNo" id="qqNo"  value="<{$shops.qqNo}>" />
										</div>
									</div>
									<div class="form-group">
									<label class="col-sm-4 control-label" for="userName">店主姓名</label>
										<div class="col-md-8">
											<input type="text" class="form-control" placeholder="店主姓名" name="userName" id="userName"  value="<{$users.userName}>" />
										</div>
									</div>
								</div>

								<div class="col-sm-6">
									<div class="form-group">
										<label>店铺Logo</label>
										<div>
											<div class="fileinput fileinput-new" data-provides="fileinput">
												<div class="fileinput-new thumbnail" style="width: 200px; height: 150px;">
													<!-- <img src="__UPLOAD__/<{$COMMON.shopLogo|str_replace='.','_m.',###}>"/> -->
													<img src="__UPLOAD__/<{$shops['shopImg']?$shops['shopImg']:$COMMON['shopLogo']|str_replace='.','_m.',###}>"/>
												</div>
												<div class="fileinput-preview fileinput-exists thumbnail" style="max-width: 200px; max-height: 150px;">
												</div>
												<div>
													<span class="btn default btn-file">
														<span class="fileinput-new">
															 选择图片
														</span>
														<span class="fileinput-exists">
															 更改图片
														</span>
														<input type="file" name="shopImg" id="shopImg">
													</span>
													<a href="#" class="btn default fileinput-exists" data-dismiss="fileinput">
														 删除图片
													</a>
												</div>
											</div>
										</div>
									</div>

									<div class="form-group">
					                    <label class="col-sm-2 control-label" for="isSelf">是否自营</label>
					                    <div class="col-md-8">
					                    <div class="radio-list">
					                      <label class="radio-inline">
					                      <input type="radio" name="isSelf" id="optionsRadios1" value="1" <if condition="$shops.isSelf eq 1">checked</if> > 是 </label>
					                      <label class="radio-inline">
					                      <input type="radio" name="isSelf" id="optionsRadios2" value="0" <if condition="$shops.isSelf eq 0">checked</if> > 否 </label>
					                    </div>
					                    </div>
					                  </div>
					                  <div class="form-group">
				                    <label class="col-sm-2 control-label" for="shopAtive">营业状态</label>
				                    <div class="col-md-8">
				                    <div class="radio-list">
				                      <label class="radio-inline">
				                      <input type="radio" name="shopAtive" id="optionsRadios1" value="1" <if condition="$shops.shopAtive eq 1">checked</if> > 营业 </label>
				                      <label class="radio-inline">
				                      <input type="radio" name="shopAtive" id="optionsRadios2" value="0" <if condition="$shops.shopAtive eq 0">checked</if> > 休假 </label>
				                    </div>
				                    </div>
				                  </div>
									
								</div>

								<div class="clearfix"></div>
								<div class="col-md-6">
									<div class="form-group">
									<label class="col-sm-4 control-label" for="userQQ">店主QQ号码</label>
										<div class="col-md-8">
											<input type="text" class="form-control" placeholder="店主QQ号码" name="userQQ" id="userQQ"  value="<{$users.userQQ}>" />
										</div>
									</div>
									
									<div class="form-group">
										<label class="col-sm-4 control-label" for="bankId">绑定银行</label>
										<div class="col-md-8">
											<select class="form-control" name="bankId" id="bankId">
													<option>请选择绑定银行</option>
											<foreach name="banks" item="val" key="key" >
													<option value="<{$val['bankId']}>" <php> echo $val['bankId'] ==$shops['bankId']?'selected':'';</php>><{$val['bankName']}></option>
											</foreach>
											</select>
										</div>
									</div>
									
								</div>
								<div class="col-md-6">
									
									<div class="form-group">
										<label class="col-sm-2 control-label" for="userPhone">店主手机</label>
										<div class="col-md-8">
											<input type="text" class="form-control" placeholder="店主联系手机" name="userPhone" id="userPhone"  value="<{$users.userPhone}>" />
										</div>
									</div>
									<div class="form-group">
										<label class="col-sm-2 control-label" for="bankNo">银行卡号</label>
										<div class="col-md-8">
											<input type="text" class="form-control" placeholder="银行卡号" name="bankNo" id="bankNo"  value="<{$shops.bankNo}>" />
										</div>
									</div>

								</div>
								<div class="clearfix"></div>


							<div class="col-md-12">
								<div class="form-group">
									<label class="col-sm-2 control-label">店铺地址</label>
										
										<div class="col-md-2" style="margin-right:-15px">
											<select  id='areaId1' class="form-control col-md-2" name="areaId1"></select>
										</div>
										<div class="col-md-2" style="margin-right:-15px;margin-left:-15px">
											<select  id='areaId2' class="form-control col-md-2" name="areaId2"></select>
										</div>
										<div class="col-md-2" style="margin-right:-15px;margin-left:-15px">		
											<select  id='areaId3' class="form-control col-md-2" name="areaId3"></select>
										</div>
										<div class="col-md-3" style="margin-left:-15px" >
											<input type="text" class="form-control" placeholder="详细地址" name="shopAddress" id="shopAddress"  value="<{$shops.shopAddress}>" />
										</div>
											
								</div>



								<div class="form-group">
									<label class="col-sm-2 control-label" for="shopAtive">店铺位置</label>
									<div class="col-md-6"  id="shopMap" style="display:none">
										<div  id="aMap" style="height:300px"></div>
									</div>
								</div>
								
					             <div style='display:none'>
						             <input type='text' id='latitude' name='latitude' value="<{$shops.latitude}>"/>
						             <input type='text' id='longitude' name='longitude' value="<{$shops.longitude}>"/>
						             <input type='text' id='mapLevel' name='mapLevel' value="<{$shops.mapLevel}>"/>
					             </div>

							</div>
							</div>
						</div>
						<div class="tab-pane" id="tab_meta">
							<div class="form-body">
								<div class="form-group">
									<label class="control-label col-md-2">营业时间</label>
									<div class="col-md-6">
										<div class="input-group">
											
												<input type="text"  name="serviceStartTime" id="serviceStartTime"  value="<{$shops.serviceStartTime}>" class="form-control timepicker serviceStartTime">
												<span class="input-group-btn">
													<button class="btn default" type="button"><i class="fa fa-clock-o"></i></button>
												</span>
												<input type="text"  name="serviceEndTime" id="serviceEndTime"  value="<{$shops.serviceEndTime}>" class="form-control timepicker serviceEndTime">
												<span class="input-group-btn">
													<button class="btn default" type="button"><i class="fa fa-clock-o"></i></button>
												</span>
											
										</div>
									</div>
								</div>
								
								<div class="form-group">
									<label class="col-sm-2 control-label" for="avgeCostMoney">平均消费金额</label>
									<div class="col-md-6">
										<input type="text" class="form-control" placeholder="平均消费金额" name="avgeCostMoney" id="avgeCostMoney"  value="<{$shops.avgeCostMoney}>" />
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label" for="deliveryStartMoney">订单配送起步价</label>
									<div class="col-md-6">
										<input type="text" class="form-control" placeholder="订单配送起步价" name="deliveryStartMoney" id="deliveryStartMoney"  value="<{$shops.deliveryStartMoney}>" />
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label" for="deliveryMoney">运费</label>
									<div class="col-md-6">
										<input type="text" class="form-control" placeholder="运费" name="deliveryMoney" id="deliveryMoney"  value="<{$shops.deliveryMoney}>" />
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label" for="deliveryFreeMoney">包邮起步价</label>
									<div class="col-md-6">
										<input type="text" class="form-control" placeholder="包邮起步价" name="deliveryFreeMoney" id="deliveryFreeMoney"  value="<{$shops.deliveryFreeMoney}>" />
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label" for="deliveryCostTime">平均配送时间</label>
									<div class="col-md-6">
										<input type="text" class="form-control" placeholder="平均配送时间" name="deliveryCostTime" id="deliveryCostTime"  value="<{$shops.deliveryCostTime}>" />
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label" for="deliveryTime">配送时间</label>
									<div class="col-md-6">
										<input type="text" class="form-control" placeholder="配送时间" name="deliveryTime" id="deliveryTime"  value="<{$shops.deliveryTime}>" />
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label" for="deliveryType">配送类型</label>
									<div class="col-md-6">
										<input type="text" class="form-control" placeholder="配送类型" name="deliveryType" id="deliveryType"  value="<{$shops.deliveryType}>" />
									</div>
								</div>
								<div class="form-group">
				                    <label class="col-sm-2 control-label" for="isInvoice">是否提供发票</label>
				                    <div class="col-md-8">
				                    <div class="radio-list">
				                      <label class="radio-inline">
				                      <input type="radio" name="isInvoice" id="optionsRadios1" value="1" <if condition="$shops.isInvoice eq 1">checked</if> > 是 </label>
				                      <label class="radio-inline">
				                      <input type="radio" name="isInvoice" id="optionsRadios2" value="0" <if condition="$shops.isInvoice eq 0">checked</if> > 否 </label>
				                    </div>
				                    </div>
				                  </div>
								
								<div class="form-group invoice" <if condition="$shops.isInvoice neq 1">style="display:none"</if>>
									<label class="col-sm-2 control-label" for="invoiceRemarks">发票备注</label>
									<div class="col-md-6">
										<input type="text" class="form-control" placeholder="发票备注" name="invoiceRemarks" id="invoiceRemarks"  value="<{$shops.invoiceRemarks}>" />
									</div>
								</div>

							</div>
						</div>
					</div>
				</div>
				<div class="col-md-12">
					<div class="form-group">
	                    <label class="col-sm-2 control-label" for="shopStatus">店铺状态</label>
	                    <div class="col-md-8">
	                    <div class="radio-list">
	                      <label class="radio-inline">
	                      <input type="radio" name="shopStatus" id="optionsRadios1" value="0" <if condition="$shops.shopStatus eq 0">checked</if> > 待审核 </label>
	                      <label class="radio-inline">
	                      <input type="radio" name="shopStatus" id="optionsRadios2" value="1" <if condition="$shops.shopStatus eq 1">checked</if> > 已审核 </label>
	                       <label class="radio-inline">
	                      <input type="radio" name="shopStatus" id="optionsRadios1" value="-1" <if condition="$shops.shopStatus eq -1">checked</if> > 已拒绝 </label>
	                      <label class="radio-inline">
	                      <input type="radio" name="shopStatus" id="optionsRadios2" value="-2" <if condition="$shops.shopStatus eq -2">checked</if> > 已停用 </label>
	                    </div>
	                    </div>
	                  </div>
					<div class="form-group refuse" style="display:none">
						<label class="col-sm-2 control-label" for="statusRemarks">拒绝理由</label>
						<div class="col-md-6">
							<input type="text" class="form-control" placeholder="拒绝理由" name="statusRemarks" id="statusRemarks"  value="<{$shops.statusRemarks}>" />
						</div>
					</div>
				
				
				</div>
					<div class="form-group fluid">
		                <div class="col-md-offset-2 col-md-9">
		                  <button type="submit" class="btn blue">保存</button>
		                  <button type="reset" class="btn default">取消</button>
		                </div>
		              </div>
              
</form>			</div>
		</div>
	</div>
</div>

</block>